﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TravianHelper.app;
using TravianHelper.hero;
using System.Xml.Serialization;
using System.Xml;
 

namespace TravianHelper.hero
{
    /**
     * All actions related to Hero go here
     **/ 
    public class HeroManager
    {



        public HeroInfo loadHeroInfo()
        {
            HeroInfo hero =  TravianApplicationContext.adapter.getHeroInfo();


            return hero;
        }

        public HeroConfig loadHeroConfigFromForm()
        {
            HeroConfig hero = new HeroConfig();
            hero.autoAdventure = TravianApplicationContext.heroPopup.isAutoAdventure();
            hero.clearOasisSolo = TravianApplicationContext.heroPopup.isClearOasisSolo();
            hero.clearOasisWithTroop = TravianApplicationContext.heroPopup.isClearOasisWithTroop();
            hero.infantry = TravianApplicationContext.heroPopup.useInfantryDef();
            hero.minHealthSolo = TravianApplicationContext.heroPopup.getMinHealthSolo();
            hero.minHealthWithTroop = TravianApplicationContext.heroPopup.getMinHealthWithTroop();
            hero.soloFightingTimes = TravianApplicationContext.heroPopup.getSoloAttackTimesVsOasisDef();
            hero.withTroopFightingTimes = TravianApplicationContext.heroPopup.getWithTroopAttackTimesVsOasisDef();
            return hero;
        }

        /**
         * TODO: Huy viet nhe
         **/
        public HeroConfig loadHeroConfigFromFile()
        {
            //Assuming doc is an XML document containing a serialized object and objType is a System.Type set to the type of the object.
            return null;
        }

    }
}
